package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qijian.maindata.domain.LineChangeDetail;
import com.qijian.maindata.domain.vo.LineChangeDetailVo;
import com.qijian.maindata.domain.vo.LineChangeVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

/**
 * 工艺变更明细Mapper接口
 *
 * @author qijian
 * @date 2022-02-22
 */
public interface LineChangeDetailMapper extends BaseMapper<LineChangeDetail> {

    @Select("select count(0) from main_line_change_detail WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    LineChangeDetailVo selectProcessIdOldData(Long processId);

    List<LineChangeDetail> selectNewestApprovalChangeByBomIds(Collection<Long> bomIds);

    List<LineChangeDetail> selectNewestApprovalBySourceIdsTypeStatus(@Param("list") Collection<Long> sourceIds,
                                                                          @Param("type") Integer type,
                                                                          @Param("status")  Integer status);

    List<LineChangeVo> selectApprovalChangeDetailsBySourceId(Long sourceId);
}
